﻿<?xml version="1.0" encoding="utf-8"?>
<xs:schema id="CreditosDS" targetNamespace="http://tempuri.org/CreditosDS.xsd" xmlns:mstns="http://tempuri.org/CreditosDS.xsd" xmlns="http://tempuri.org/CreditosDS.xsd" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata" xmlns:msprop="urn:schemas-microsoft-com:xml-msprop" attributeFormDefault="qualified" elementFormDefault="qualified">
  <xs:annotation>
    <xs:appinfo source="urn:schemas-microsoft-com:xml-msdatasource">
      <DataSource DefaultConnectionIndex="0" FunctionsComponentName="QueriesTableAdapter" Modifier="AutoLayout, AnsiClass, Class, Public" SchemaSerializationMode="IncludeSchema" xmlns="urn:schemas-microsoft-com:xml-msdatasource">
        <Connections>
          <Connection AppSettingsObjectName="Settings" AppSettingsPropertyName="BDInventoryConnectionString" ConnectionStringObject="" IsAppSettingsProperty="true" Modifier="Assembly" Name="BDInventoryConnectionString (Settings)" ParameterPrefix="@" PropertyReference="ApplicationSettings.Ucb.Workshop.Dal.Properties.Settings.GlobalReference.Default.BDInventoryConnectionString" Provider="System.Data.SqlClient" />
        </Connections>
        <Tables>
          <TableAdapter BaseClass="System.ComponentModel.Component" DataAccessorModifier="AutoLayout, AnsiClass, Class, Public" DataAccessorName="creditoTableAdapter" GeneratorDataComponentClassName="creditoTableAdapter" Name="credito" UserDataComponentName="creditoTableAdapter">
            <MainSource>
              <DbSource ConnectionRef="BDInventoryConnectionString (Settings)" DbObjectType="Unknown" FillMethodModifier="Public" FillMethodName="Fill" GenerateMethods="Both" GenerateShortCommands="false" GeneratorGetMethodName="GetData" GeneratorSourceName="Fill" GetMethodModifier="Public" GetMethodName="GetData" QueryType="Rowset" ScalarCallRetval="System.Object, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" UseOptimisticConcurrency="false" UserGetMethodName="GetData" UserSourceName="Fill">
                <SelectCommand>
                  <DbCommand CommandType="Text" ModifiedByUser="true">
                    <CommandText>SELECT DISTINCT c.cod_credito, prov.empresa, c.fecha, c.monto, cp.fecha AS Expr1, cp.total, cp.total - c.monto AS Expr2, prov.empresa AS Expr3
FROM            credito AS c INNER JOIN
                         compra AS cp ON c.cod_compra = cp.cod_compra INNER JOIN
                         detalle_compra AS dc ON cp.cod_compra = dc.cod_compra INNER JOIN
                         provee AS pv ON dc.cod_provee = pv.cod_provee INNER JOIN
                         proveedor AS prov ON pv.cod_proveedor = prov.cod_proveedor</CommandText>
                    <Parameters />
                  </DbCommand>
                </SelectCommand>
              </DbSource>
            </MainSource>
            <Mappings>
              <Mapping SourceColumn="cod_credito" DataSetColumn="cod_credito" />
              <Mapping SourceColumn="fecha" DataSetColumn="fecha" />
              <Mapping SourceColumn="monto" DataSetColumn="monto" />
              <Mapping SourceColumn="empresa" DataSetColumn="empresa" />
              <Mapping SourceColumn="Expr1" DataSetColumn="Expr1" />
              <Mapping SourceColumn="total" DataSetColumn="total" />
              <Mapping SourceColumn="Expr2" DataSetColumn="Expr2" />
              <Mapping SourceColumn="Expr3" DataSetColumn="Expr3" />
            </Mappings>
            <Sources />
          </TableAdapter>
        </Tables>
        <Sources />
      </DataSource>
    </xs:appinfo>
  </xs:annotation>
  <xs:element name="CreditosDS" msdata:IsDataSet="true" msdata:UseCurrentLocale="true" msprop:Generator_UserDSName="CreditosDS" msprop:Generator_DataSetName="CreditosDS" msprop:EnableTableAdapterManager="True">
    <xs:complexType>
      <xs:choice minOccurs="0" maxOccurs="unbounded">
        <xs:element name="credito" msprop:Generator_UserTableName="credito" msprop:Generator_RowDeletedName="creditoRowDeleted" msprop:Generator_RowChangedName="creditoRowChanged" msprop:Generator_RowClassName="creditoRow" msprop:Generator_RowChangingName="creditoRowChanging" msprop:Generator_RowEvArgName="creditoRowChangeEvent" msprop:Generator_RowEvHandlerName="creditoRowChangeEventHandler" msprop:Generator_TableClassName="creditoDataTable" msprop:Generator_TableVarName="tablecredito" msprop:Generator_RowDeletingName="creditoRowDeleting" msprop:Generator_TablePropName="credito">
          <xs:complexType>
            <xs:sequence>
              <xs:element name="cod_credito" msdata:ReadOnly="true" msdata:AutoIncrement="true" msdata:AutoIncrementSeed="-1" msdata:AutoIncrementStep="-1" msprop:Generator_UserColumnName="cod_credito" msprop:Generator_ColumnVarNameInTable="columncod_credito" msprop:Generator_ColumnPropNameInRow="cod_credito" msprop:Generator_ColumnPropNameInTable="cod_creditoColumn" type="xs:int" />
              <xs:element name="fecha" msprop:Generator_UserColumnName="fecha" msprop:Generator_ColumnVarNameInTable="columnfecha" msprop:Generator_ColumnPropNameInRow="fecha" msprop:Generator_ColumnPropNameInTable="fechaColumn" type="xs:dateTime" minOccurs="0" />
              <xs:element name="monto" msprop:Generator_UserColumnName="monto" msprop:Generator_ColumnVarNameInTable="columnmonto" msprop:Generator_ColumnPropNameInRow="monto" msprop:Generator_ColumnPropNameInTable="montoColumn" type="xs:double" minOccurs="0" />
              <xs:element name="empresa" msprop:Generator_UserColumnName="empresa" msprop:Generator_ColumnPropNameInRow="empresa" msprop:Generator_ColumnVarNameInTable="columnempresa" msprop:Generator_ColumnPropNameInTable="empresaColumn" minOccurs="0">
                <xs:simpleType>
                  <xs:restriction base="xs:string">
                    <xs:maxLength value="100" />
                  </xs:restriction>
                </xs:simpleType>
              </xs:element>
              <xs:element name="Expr1" msprop:Generator_UserColumnName="Expr1" msprop:Generator_ColumnPropNameInRow="Expr1" msprop:Generator_ColumnVarNameInTable="columnExpr1" msprop:Generator_ColumnPropNameInTable="Expr1Column" type="xs:dateTime" minOccurs="0" />
              <xs:element name="total" msprop:Generator_UserColumnName="total" msprop:Generator_ColumnPropNameInRow="total" msprop:Generator_ColumnVarNameInTable="columntotal" msprop:Generator_ColumnPropNameInTable="totalColumn" type="xs:double" minOccurs="0" />
              <xs:element name="Expr2" msdata:ReadOnly="true" msprop:Generator_UserColumnName="Expr2" msprop:Generator_ColumnPropNameInRow="Expr2" msprop:Generator_ColumnVarNameInTable="columnExpr2" msprop:Generator_ColumnPropNameInTable="Expr2Column" type="xs:double" minOccurs="0" />
              <xs:element name="Expr3" msprop:Generator_UserColumnName="Expr3" msprop:Generator_ColumnPropNameInRow="Expr3" msprop:Generator_ColumnVarNameInTable="columnExpr3" msprop:Generator_ColumnPropNameInTable="Expr3Column" minOccurs="0">
                <xs:simpleType>
                  <xs:restriction base="xs:string">
                    <xs:maxLength value="100" />
                  </xs:restriction>
                </xs:simpleType>
              </xs:element>
            </xs:sequence>
          </xs:complexType>
        </xs:element>
      </xs:choice>
    </xs:complexType>
    <xs:unique name="Constraint1" msdata:PrimaryKey="true">
      <xs:selector xpath=".//mstns:credito" />
      <xs:field xpath="mstns:cod_credito" />
    </xs:unique>
  </xs:element>
</xs:schema>